<?php

namespace app\common\model;

//use think\Model;
//图形验证码
class CaptchaModel extends BaseModel {

	protected $table = 'tp_captcha';

	public function setCaptcha($k,$v){
		$res = $this->insert([
        	'k'=>$k,
        	'v'=>$v,
        	'date'=>date('Y-m-d H:i:s',time())
        ]);
        return $res;
	}


	public function getCaptcha($k){
		$data = $this->where('k',$k)->find();
		return $data;
	}

	public function delCaptcha($id){
		$res = $this->where('id',$id)->delete();
		return $res;
	}
}
